import { defHttp } from "@/utils/http";

// ERP 投标明细 VO
export interface BidBiddingExVO {
	id: number; // 主键
	biddingId: string; // 投标Id
	drugId: string; // 药品ID
	materialName: string; // 原材料名称
	materialQty: string; // 原料质量等级
	productQty: string; // 产品质量等级
	bidQty: string; // 投标数量
	invtInQty: string; // 已入库数量
	bidPrice: string; // 投标单价
}

// ERP 投标明细 API
export const BidBiddingExApi = {
	// 查询投标明细分页
	getBidBiddingExPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/bidding-ex/page`, params });
	},

	// 查询投标明细详情
	getBidBiddingEx: async (id: number) => {
		return await defHttp.get({ url: `/whs/bidding-ex/get?id=` + id });
	},

	// 新增投标明细
	createBidBiddingEx: async (data: BidBiddingExVO) => {
		return await defHttp.post({ url: `/whs/bidding-ex/create`, data });
	},

	// 修改投标明细
	updateBidBiddingEx: async (data: BidBiddingExVO) => {
		return await defHttp.put({ url: `/whs/bidding-ex/update`, data });
	},

	// 删除投标明细
	deleteBidBiddingEx: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/bidding-ex/delete?id=` + id
		});
	},

	// 导出投标明细 Excel
	exportBidBiddingEx: async (params: any) => {
		return await defHttp.download({ url: `/whs/bidding-ex/export-excel`, params });
	}
};
